package com.haredot.handler;

import com.haredot.entity.User;

public class TokenContextHolder {

    private static final ThreadLocal<User>  threadLocal = new ThreadLocal<>() ;

    public static void setAuthenticationUser(User user) {
        threadLocal.set(user);
    }

    public static User getCurrentUser() {
        return threadLocal.get();
    }

    public static void clear() {
        threadLocal.remove();
    }
}
